/*
 *  iam.c:	test sys_iam
 *
 *  July 27, 2010
 *  clzqwdy@gmail.com
 */

#define __LIBRARY__		/* 有它, _syscall1等才有效, 详见unistd.h */
#include <unistd.h>		/* 因为_syscall1宏中有系统调用号__NR_whoami的定义 */

_syscall1(int, iam, const char*, name)	/* iam()在用户空间的接口函数 */

int main(int argc, char* argv[])
{
	int res;
	if (argc != 2)
		exit(1);
	
	res = iam(argv[1]);
	if (res < 0)
		exit(1);
	else
		exit(0);
}
